<template>
	<view class="notice">
		<view class="main">
			<!-- <image v-if="info.image" :src="info.image" mode="widthFix"></image> -->
			<view class="title"> {{info.title}} </view>
			<view class="time"> {{info.time}} </view>
			<view class="neirong">
				<u-parse :html="info.content"></u-parse>
			</view>
			<video :src="info.video" v-if="info.video" class="_video"></video>
		</view>
	</view>
</template>

<script>
  export default {
    data() {
      return {
        info: {

        },
        type: ''
      };
    },
    mounted() {

    },
    onLoad(option) {
      this.type = option.type
      console.log(option.id, "接受id");

      if (option.type == 3) {
        uni.setNavigationBarTitle({
          title: '新闻详情'
        });
        this.$http('common.news', {
          cate_id: option.id
        }).then(res => {
          this.info = res.data.detail
          console.log(this.info, "+++++++++++")
        });
      } else if (option.type == 2) {
        var that = this;
        that.$http('common.playinfo', {
          type: 3,
          id: option.id
        }).then(res => {
          if (res.code === 1) {
            uni.setNavigationBarTitle({
              title: res.data.title
            });
            this.info = res.data;
          }
        });
      } else {
        this.$http('common.playinfo', {
          id: option.id
        }).then((res) => {
          this.info = res.data;
          console.log(res, "zhou1")
        });

      }


    },
    methods: {
      fanhui() {
        uni.navigateTo({
          // url: 'test?id=1&name=uniapp'  c传递参数
          url: "/pages/index/index"
        })
      },

    }
  };
</script>

<style lang="scss" scoped>
	.notice {
		background: white;
		// .name {
		// 	background: white;
		// 	box-shadow: 20rpx 0rpx 14rpx 10rpx #F0F0F0;
		// 	text-align: center;
		// 	position: relative;
		// 	overflow: hidden;
		// 	padding: 36rpx 0;
		// 	// color: white;
		// 	font-weight: bold;
		// 	font-size: 30rpx;

		// 	image {
		// 		width: 39rpx;
		// 		height: 39rpx;
		// 		position: absolute;
		// 		left: 30rpx;
		// 	}
		// }

		.main {
			width: 100%;

			image {
				width: 100%;
			}

			.title {
				text-align: center;
				font-size: 30rpx;
				font-weight: bold;
			}

			.time {
				text-align: center;
				padding: 40rpx 0;
			}

			.neirong {
				// text-indent: 2rem;
				font-size: 30rpx;
				// font-weight: 500;
			}

			._video {
				width: 100%;
			}
		}

	}
</style>
